<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@include file="../common/head.jsp"%>
<div class="right">
    <div class="location">
        <strong>你现在所在的位置是:</strong>
        <span>用户管理页面 >> 用户修改页面</span>
    </div>
    <div class="providerAdd">
        <form id="userForm" name="userForm" method="post" action="UserModifyDoServlet.action">
<%--            <form id="userForm" name="userForm" method="post" action="UserModifyDoServlet.action?userId=${requestScope.user.userId}">--%>
            <input type="hidden" name="userId" value="${requestScope.user.userId }"/>
            <div>
                <label for="userName">用户姓名：</label>
                <input type="text" name="userName" id="userName" value="${requestScope.user.userName }">
                <font color="red"></font>
            </div>
            <div>
                <label >用户性别：</label>
                <input type="radio" name="gender" value="1" <c:if test="${requestScope.user.gender==1}">checked</c:if> >男
                <input type="radio" name="gender" value="2" <c:if test="${requestScope.user.gender==2}">checked</c:if> >女
            </div>
            <div>
                <label for="birthday">出生日期：</label>
                <fmt:formatDate value="${requestScope.user.birthday }" pattern="yyyy-MM-dd" var="birthday"/>
                <input type="text" Class="Wdate" id="birthday" name="birthday" value="${pageScope.birthday}">
                <font color="red"></font>
            </div>

            <div>
                <label for="phone">用户电话：</label>
                <input type="text" name="phone" id="phone" value="${requestScope.user.phone }">
                <font color="red"></font>
            </div>
            <div>
                <label for="address">用户地址：</label>
                <input type="text" name="address" id="address" value="${requestScope.user.address }">
            </div>
            <div>
                <label >用户角色：</label>
                <!-- 列出所有的角色分类 -->
                <select name="role.roleId" id="userRole">
                    <c:forEach items="${requestScope.roleList}" var="role">
                        <option <c:if test="${role.roleId==requestScope.user.role.roleId}"> selected </c:if> value="${role.roleId}">${role.roleName}</option>
                    </c:forEach>
                </select>
                <font color="red"></font>
            </div>
            <div class="providerAddBtn">
                <input type="submit" name="save" id="save" value="保存" />
                <input type="button" id="back" name="back" onclick="history.back()" value="返回"/>
            </div>
        </form>
    </div>
</div>
</section>
<%@include file="../common/foot.jsp" %>
